package com.bonc.jedis.example;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.Pipeline;

public class PipelineExmpl {
	public static void main(String[] args) {
		Jedis jedis = null;
		try {
			jedis = new Jedis(new HostAndPort("192.168.1.136", 6379));
			Pipeline pipe = jedis.pipelined();
			pipe.multi();
			pipe.set("pipe:hello", "hello");
			pipe.set("pipe:world", "world");
			pipe.exec();
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (jedis!=null) {
				jedis.close();
			}
		}
	}
}
